// To change this License template, choose Tools / Templates
// and edit Licenses / FanDefaultLicense.txt
//
// History:
//   21.01.2011 jst Creation
//

**
** TableDef
**
class Table
{
    Database database
    Str name  
    Str:Column columns := [:]    
            
    new make(Str name, |This|? closure:=null) {
       columns.ordered = true   
       this.name = name
       if (closure!=null) closure()   
    }

    @Operator
    This add(Column column) {
      column.table = this
      columns.add(column)    
    }
    
    Column column(Str name, Type type) {
      Column col := Column(name,type)
      add(col)
      return col      
    }  
        
        
}